docs: add hooks, user input, and auth options to SDK READMEs#270
docs: add hooks, user input, and auth options to SDK READMEs#270
Conversation
Update all SDK documentation with new features from PRs #237 and #269: - Add githubToken and useLoggedInUser client options for authentication - Add onUserInputRequest handler for enabling ask_user tool - Add hooks configuration for session lifecycle events - Add User Input Requests section with examples - Add Session Hooks section documenting all available hooks: - onPreToolUse, onPostToolUse, onUserPromptSubmitted - onSessionStart, onSessionEnd, onErrorOccurred
There was a problem hiding this comment.
Pull request overview
This PR updates the documentation for all four SDK implementations (Python, Node.js, Go, and .NET) to include new authentication and session lifecycle features introduced in PRs #237 and #269.
Changes:
- Added
githubToken/GithubTokenanduseLoggedInUser/UseLoggedInUserauthentication options to client configuration documentation - Added comprehensive "User Input Requests" section documenting the
onUserInputRequest/OnUserInputRequesthandler for theask_usertool - Added comprehensive "Session Hooks" section documenting six lifecycle hooks:
onPreToolUse,onPostToolUse,onUserPromptSubmitted,onSessionStart,onSessionEnd, andonErrorOccurred
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| python/README.md | Added authentication options, user input request handler, and session hooks documentation with Python-style examples |
| nodejs/README.md | Added authentication options, user input request handler, and session hooks documentation with TypeScript examples |
| go/README.md | Added authentication options, user input request handler, and session hooks documentation with Go-style examples |
| dotnet/README.md | Added authentication options, user input request handler, and session hooks documentation with C# examples |
Comments suppressed due to low confidence (4)
dotnet/README.md:488
- The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
Model = "gpt-5",
python/README.md:424
- The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
"model": "gpt-5",
nodejs/README.md:509
- The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
model: "gpt-5",
go/README.md:410
- The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
Model: "gpt-5",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ```go | ||
| session, err := client.CreateSession(&copilot.SessionConfig{ | ||
| Model: "gpt-5", |
There was a problem hiding this comment.
The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
| ```csharp | ||
| var session = await client.CreateSessionAsync(new SessionConfig | ||
| { | ||
| Model = "gpt-5", |
There was a problem hiding this comment.
The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
| } | ||
|
|
||
| session = await client.create_session({ | ||
| "model": "gpt-5", |
There was a problem hiding this comment.
The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
|
|
||
| ```typescript | ||
| const session = await client.createSession({ | ||
| model: "gpt-5", |
There was a problem hiding this comment.
The example uses model "gpt-5", but this model does not exist. OpenAI's latest models are GPT-4 variants (e.g., "gpt-4", "gpt-4-turbo", "gpt-4o"). Using a non-existent model in documentation examples could confuse users.
✅ Cross-SDK Consistency Review: PASSEDThis PR maintains excellent consistency across all four SDK implementations (Node.js/TypeScript, Python, Go, and .NET). The documentation updates correctly follow language-specific naming conventions while maintaining semantic parity. Features Documented Consistently Across All SDKs:1. Authentication Options (Client-level)
2. User Input Requests (Session-level)
3. Session Hooks (Session-level)All six hooks documented consistently:
Naming Convention Compliance:
Code Examples:All four SDKs include parallel code examples showing:
No cross-SDK consistency issues found. This PR successfully documents the features from PRs #237 and #269 across all SDK implementations with appropriate language idioms. 🎉
|
Update all SDK documentation with new features from PRs #237 and #269: